package reflect;

import java.lang.reflect.Method;

import reflect.annotations.AutoRunMethod;

public class test3 {
    public static void main(String[] args) throws Exception  {
        Class c = Class.forName("reflect.Person");
        Object p = c.newInstance();

        Method[] methods = c.getMethods();
        for(Method m : methods)
        {
            if (m.isAnnotationPresent(AutoRunMethod.class)) 
            {
                int count = m.getAnnotation(AutoRunMethod.class).value();
                for(int i = 0 ; i < count ; i++)
                {
                    m.invoke(p);
                }
            }
        }

    }
}
